package com.group.controller;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.group.pojo.TbBill;
import com.group.pojo.TbUser;
import com.group.pojo.TbVerify;
import com.group.service.BillService;
import com.group.service.VerifyService;

@Controller
@RequestMapping("/verify")
public class VerifyController {
	@Autowired
	private VerifyService verifyService;

	// 报修审核
	@RequestMapping("/page.action")
	public String verifyPage() {
		return "verify/verify";
	}

	// 审核一览
	@RequestMapping("/view.action")
	public String view() {
		return "verify/view";
	}

	
	// 获取所有的审核单
	@RequestMapping("/query.action")
	@ResponseBody
	public List<TbVerify> query(TbVerify verify, HttpServletRequest request) {
		TbUser loginUser = (TbUser) request.getSession().getAttribute("USER_SESSION");
		verify.setVerifyUserId(loginUser.getId());
		List<TbVerify> list = verifyService.query(verify);
		return list;
	}
	
	
	// 获取所有的审核单
	@RequestMapping("/save.action")
	@ResponseBody
	public Map<String, String> save(TbVerify verify, HttpServletRequest request) {
		Map<String, String> map = verifyService.save(verify, request);
		return map;
	}

	 
}
